﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage2.master" AutoEventWireup="true" CodeFile="NewsforADMIN.aspx.cs" Inherits="NewsforADMIN" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div class="hms" align ="center">

    <h1 style="font-family: 'Times New Roman', Times, serif; color: #0000FF; font-size: xx-small">
        &nbsp;</h1>
    <h1 style="font-family: 'Times New Roman', Times, serif; color: #0000FF; font-size: xx-large;">
&nbsp;<span style="font-family: 'Bradley Hand ITC'">News Information</span></h1>
<h1 style="font-family: 'Times New Roman', Times, serif">
    <asp:Label ID="txtID" runat="server" Text="ID" Visible="False"></asp:Label></h1>
    <h1 style="font-family: 'Times New Roman', Times, serif">
        &nbsp;<span style="font-family: 'Bradley Hand ITC'">Title:</span>&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="txtTitle" runat="server" Width="427px" 
            style="font-family: 'Times New Roman', Times, serif" Font-Bold="True" 
            Font-Size="Large" ></asp:TextBox>
    &nbsp;&nbsp;&nbsp;
        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
            ControlToValidate="txtTitle" ErrorMessage="Title cannot black" 
            ForeColor="Red" SetFocusOnError="True"></asp:RequiredFieldValidator>
    </h1>
    <h1 style="font-family: 'Times New Roman', Times, serif">
        &nbsp;<span style="font-family: 'Bradley Hand ITC'">News:</span>&nbsp;&nbsp;&nbsp;
        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
            ControlToValidate="txtNews" ErrorMessage="News cannot black" 
            ForeColor="Red" SetFocusOnError="True"></asp:RequiredFieldValidator>
        </h1>
    <p style="font-family: 'Times New Roman', Times, serif">
        <asp:TextBox ID="txtNews" runat="server" Font-Bold="True" Font-Size="Large" 
            Height="125px" TextMode="MultiLine" 
            Width="939px"></asp:TextBox>
    </p>
    <h1 style="font-family: 'Times New Roman', Times, serif">
        &nbsp;&nbsp;&nbsp;<span style="font-family: 'Bradley Hand ITC'">Image:</span><span style="font-family: 'Times New Roman', Times, serif">&nbsp;&nbsp;&nbsp; </span>
        <asp:FileUpload ID="FileUpload1" runat="server" 
            style="font-family: 'Times New Roman', Times, serif" Font-Bold="False" 
            Font-Size="Small" />
    &nbsp;&nbsp;&nbsp;
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
            ControlToValidate="FileUpload1" ErrorMessage="Search image again" 
            ForeColor="Red" SetFocusOnError="True"></asp:RequiredFieldValidator>
    </h1>
    <p style="font-family: 'Times New Roman', Times, serif">
        <asp:Image ID="Image1" runat="server" Visible="False" />
    </p>
    <p>
        <asp:Button ID="btnInsert" runat="server" Text="Add new" Font-Bold="False" 
            Font-Size="Small" onclick="btnInsert_Click" Width="109px" />
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="btnUpdate" runat="server" Text="Update" Font-Bold="False" 
            Font-Size="Small" onclick="btnUpdate_Click" Width="109px" />
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="btnDelete" runat="server" Font-Bold="False" Font-Size="Small" 
            onclick="btnDelete_Click" Text="Delete" Width="109px" />
    </p>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataKeyNames="ID" onrowdeleting="GridView1_RowDeleting" 
            onselectedindexchanged="GridView1_SelectedIndexChanged" Width="1087px">
            <Columns>
                <asp:BoundField DataField="ID" HeaderText="ID" />
                <asp:BoundField DataField="Title" HeaderText="Title" />
                <asp:BoundField DataField="News" HeaderText="News" />
                <asp:ImageField DataImageUrlField="Photo" ItemStyle-Width="100" ItemStyle-Height="100" HeaderText="Image">
                </asp:ImageField>
                <asp:CommandField ShowSelectButton="True" />
            </Columns>
        </asp:GridView>
    <p>
        <asp:LinkButton ID="LinkButton1" runat="server" PostBackUrl="~/AdminPage.aspx">Back to page for Admin</asp:LinkButton>
        </p>
    <p style="font-family: 'Times New Roman', Times, serif">
        &nbsp;</p>
        </div>
</asp:Content>

